package com.lh0811.forge.dependency.security.client;


import com.lh0811.forge.dependency.security.client.component.provide.ProvideResToSecurityClient;
import com.lh0811.forge.dependency.security.client.component.provide.impl.DefaultProvideResToSecurityClient;
import com.lh0811.forge.dependency.security.client.service.SecurityClient;
import com.lh0811.forge.dependency.security.client.service.impl.DefaultSecurityClientImpl;
import com.lh0811.forge.dependency.security.core.model.properties.SecurityBootProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * 自动装配
 * <p>
 * 将安全组件委托到springContext
 */
@Slf4j
@Configuration
@EnableConfigurationProperties({SecurityBootProperties.class})
public class SecurityClientAutoConfiguration {

//    @Bean
//    public HasUrlAop hasUrlAop() {
//        return new HasUrlAop();
//    }
//
//    @Bean
//    public HasACLCodeAop hasACLCodeAop() {
//        return new HasACLCodeAop();
//    }
//
//    @Bean
//    public TokenToAuthorityAop tokenToAuthorityAop() {
//        return new TokenToAuthorityAop();
//    }

    @Bean
    public SecurityClient securityClient() {
        return new DefaultSecurityClientImpl();
    }

    @Bean
    public ProvideResToSecurityClient provideResToSecurityClient() {
        return new DefaultProvideResToSecurityClient();
    }

}
